import Cookies from 'js-cookie';
const Token = 'Admin-Token';
const userName ='username';
const nickName ='nickname';

const Permission = 'Admin-Permission'

// 用户
export function getToken() {
    return Cookies.get(Token)
}
export function setToken(token) {
    return Cookies.set(Token, token)
}
export function removeToken() {
    return Cookies.remove(Token)
}
export function getUserName() {
    return Cookies.get(userName)
}
export function setUserName(username) {
    return Cookies.set(userName, username)
}
export function removeUserName() {
    return Cookies.remove(userName)
}

export function getNickName() {
    return Cookies.get(nickName)
}
export function setNickName(nickname) {
    return Cookies.set(nickName, nickname)
}
export function removeNickName() {
    return Cookies.remove(nickName)
}

// 权限
export function getPermission() {
    return JSON.parse(localStorage.getItem(Permission));
}
export function setPermission(ary) {
    return localStorage.setItem(Permission, JSON.stringify(ary))
}
export function removePermission() {
    return localStorage.removeItem(Permission)
}

